package junior.db.dao.query;

import junior.db.dao.base.IEntityTypeAssigned;

import java.util.List;

/**
 * @author wubo
 * @date 2024/9/9 10:59
 */
public class ConstantQuery extends AbstractQuery<ConstantQuery> implements IEntityTypeAssigned {
    
    public ConstantQuery() {
    
    }
    
    public ConstantQuery(String alias) {
        super.withPrefix(alias);
    }
    
    @Override
    public void setEntityClass(Class<?> entityClass) {
        // do nothing
    }
    
    @Override
    public List<ISelectItem> getFinalSelectFields() {
        if (super.isSelectAll()) {
            return List.of(new SelectExpression("*", null));
        }
        return super.getFinalSelectFields();
    }
}
